Background: Sodas are widely sold in vending machines and other school venues in the United States, particularly in high school. Research suggests that policy changes have reduced soda access, but the impact of reduced access on consumption is unclear. This study was designed to identify student, environmental, or policy characteristics that modify the associations between school vending machines and student dietary behaviors. Methods: Data on school vending machine access and student diet were obtained as part of the National Youth Physical Activity and Nutrition Study (NYPANS) and linked to state-level data on soda taxes, restaurant taxes, and state laws governing the sale of soda in schools. Regression models were used to: 1) estimate associations between vending machine access and soda consumption, fast food consumption, and lunch source, and 2) determine if associations were modified by state soda taxes, restaurant taxes, laws banning in-school soda sales, or student characteristics (race/ethnicity, sex, home food access, weight loss behaviors.) Results: Contrary to the hypothesis, students tended to consume 0.53 fewer servings of soda/week (95% CI: -1.17, 0.11) and consume fast food on 0.24 fewer days/week (95% CI: -0.44, -0.05) if they had in-school access to vending machines. They were also less likely to consume soda daily (23.9% vs. 27.9%, average difference = -4.02, 95% CI: -7.28, -0.76). However, these inverse associations were observed primarily among states with lower soda and restaurant tax rates (relative to general food tax rates) and states that did not ban in-school soda sales. Associations did not vary by any student characteristics except for weight loss behaviors. Conclusion: Isolated changes to the school food environment may have unintended consequences unless policymakers incorporate other initiatives designed to discourage overall soda consumption.